package com.example.algorithm.insertionsort;

import com.example.algorithm.util.ArrayGenerator;
import com.example.algorithm.util.SortingHelper;

import java.util.Arrays;

public class SelectionCompareToInsertion {

    public static void main(String[] args) {
        int[] dataSize = {10000, 100000};
        for (int n  : dataSize) {
            System.out.println("Random Array:");
            Integer[] arr = ArrayGenerator.generateRandomArray(n,n);
            Integer[] arr2 = Arrays.copyOf(arr, arr.length);
            SortingHelper.sortTest("SelectionSort", arr);
            SortingHelper.sortTest("InsertionSort2", arr2);

            System.out.println();
            System.out.println("Ordered Array:");
            Integer[] arr3 = ArrayGenerator.generateOrderedArray(n);
            Integer[] arr4 = Arrays.copyOf(arr3, arr3.length);
            SortingHelper.sortTest("SelectionSort", arr3);
            SortingHelper.sortTest("InsertionSort2", arr4);
            System.out.println();
        }
    }
}
